package generic;

/**
 * Created by butterfly on 2018/6/13.
 */
public class Apple<T> {


    T getSize(T t){
        return t;
    }

    public static void main(String[] args) {
        Apple<String> apple = new Apple<>();
        String size = apple.getSize("3");
        //泛型擦除，会丢失泛型
        Apple b = apple;
        Object size1 = b.getSize("1");

        Apple<Integer> c = b;//编译通过
    }
}
